//
//  ImageCollectionViewCell.m
//  时光电影项目
//
//  Created by 墨狂之逸才 on 15/7/22.
//  Copyright (c) 2015年 墨狂之逸才. All rights reserved.
//

#import "ImageCollectionViewCell.h"
#import "UIImageView+WebCache.h"
@implementation ImageCollectionViewCell


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        
        [self _creatSubImage];
        
    }
    
    return self;
}


#pragma mark - 创建子控件
- (void)_creatSubImage
{
    _imageView = [[UIImageView alloc]initWithFrame:self.bounds];
    
    
    [self.contentView addSubview:_imageView];
}


- (void)setModal:(ImageModal *)modal
{
    _modal = modal;
    [self setNeedsLayout];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    
    NSURL *url = [[NSURL alloc]initWithString:_modal.image];
    [_imageView sd_setImageWithURL:url];
    
    //调整图片
    _imageView.layer.borderWidth = 1;
    _imageView.layer.masksToBounds = YES;
    _imageView.layer.cornerRadius = 15;
    _imageView.layer.borderColor = [UIColor whiteColor].CGColor;
    
    
    
    
}

@end
